<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
<%@ page import="org.springframework.context.ApplicationContext" %>
<%@ page import="com.sz.common.ICommonDAO" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

String style1 = "width: 40%;text-align:right;font-size: 12px;";
String style2 = "width: 250px";
String style3 = "width: 40%;color: red;text-align:left;";

ServletContext servletContext = request.getSession().getServletContext(); 
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
ICommonDAO dao = (ICommonDAO) context.getBean("CommonDAO");
List list = dao.getDicValueList("MANAGER_TYPE");
%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<link href="<%= request.getContextPath() %>/css/main.css" rel="stylesheet" type="text/css" />
	<head>
		<base href="<%=basePath%>">

		<title>业务量统计</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="addManager">
		<meta http-equiv="description" content="业务量统计">
	</head>
	
	<body>
	  	<form name="addManager_form"  action="addManager.exec" method="post" onsubmit="return check()"> 
	  	 <table width="100%" height="250px" border="0" cellpadding="0" cellspacing="0">
	  	 <tr>
		  	<td colspan="3" class="title0">业务量统计</td>
		  	
	  	</tr>	
  		<tr>
		  	<td style="<%=style1%>">用户名&nbsp;</td>
		  	<td>
		  		<input type="text" id="name" name="name"  style="<%=style2%>">
		  	</td>
		  	<td style="<%=style3%>">*</td>
	  	</tr>
  		<tr>
		  	<td style="<%=style1%>">密码&nbsp;</td>
		  	<td>
		  		<input type="password" id="passwords" name="passwords" style="<%=style2%>">
		  	</td>
		  	<td style="<%=style3%>">*</td>
	  	</tr>
	  	<tr>
		  	<td style="<%=style1%>">确认密码&nbsp;</td>
		  	<td>
		  		<input type="password" id="passwords2" name="passwords2" style="<%=style2%>">
		  	</td>
		  	<td style="<%=style3%>">*</td>
	  	</tr>
	  	<tr>
		  	<td style="<%=style1%>">备注&nbsp;</td>
		  	<td>
		  		<input type="text" id="descrip" name="descrip" style="<%=style2%>">
		  	</td>
	  	</tr>	  	

	  	<tr>
		  	<td style="<%=style1%>">用户类型&nbsp;</td>
		  	<td>
				<select id="type" name="type" style="<%=style2%>">
				   <%
				   String value = null;
				   String text = null;
				   %>
				   
				   <%
				   for(int n = 0; n < list.size(); ++n) { 
					   
					   Map map = (Map)list.get(n);
					   value = map.get("DIC_VALUE").toString();
					   text = map.get("DIC_TEXT").toString();
				   %>
				   <option value="<%=value%>"><%=text%></option>
				   <%}%>				   
				</select>

		  	</td>
	  	</tr>
	  	<tr>
		  	<td colspan="3" class="title0">
<input type="submit" value="提交"> 
	  	</td>
		  	
	  	</tr>  		  	 	
	  	</table>
	  	
	  		
  	</form> 
  	
  	<SCRIPT LANGUAGE="JavaScript">
  		function check() {
  			var u = document.getElementById("name").value;
  			var p = document.getElementById("passwords").value;
  			var p2 = document.getElementById("passwords2").value;
  			var type = document.getElementById("type").value;
  			
  			if(u=="") {
  				alert("请输入用户名");
  				return false;
  			}
  			  			
  			if(p != p2) {
  				alert("两次输入的密码不一致");
  				return false;
  			}
   			if(p=="") {
  				alert("请输入密码");
  				return false; 			
  			}

   			if(type == 0) {
  				alert("请指令员工类型");
  				return false; 	
   			}
  			return true;
  			
  		}
  	
  	</SCRIPT>
	</body>
</html>
